<template>
  <van-tabs v-model="activeIndex">
    <van-tab v-for="(item,index) in tabsList" :title="item.title" :key="`tabs_item_${index}`">
      <slot name="tabItem"></slot>
    </van-tab>
  </van-tabs>
</template>

<script>
import { Tab, Tabs } from "vant";
Vue.use(Tab).use(Tabs);
export default {
  props: {
    tabsList: {
      type: Array,
      default: () => []
    },
    value: {
      type: Number,
      default: 0
    }
  },
  data(){
    return {
      activeIndex: 0
    }
  },
  watch: {
    activeIndex(v){
      this.$emit('input', v)
    }
  }
};
</script>

<style scoped>
</style>
